<template>
    <div class="user">
        <el-row>
        <el-col :span="24"> 
            <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item><a href="/">用户管理</a></el-breadcrumb-item>
                <el-breadcrumb-item>用户列表</el-breadcrumb-item>
            </el-breadcrumb>
            </el-col>
        </el-row>

        <el-row>
        <el-col :span="24">
            <el-input placeholder="请输入内容" v-model="input5" class="input-with-select search-input">
             <el-button slot="append" icon="el-icon-search"></el-button>
            </el-input>
            <el-button type="success" plain>添加用户</el-button>
            </el-col>
        </el-row>

            <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column
        type="index"
        width="50">
        </el-table-column>
        <el-table-column
        prop="username"
        label="姓名"
        width="180">
        </el-table-column>
        <el-table-column
        prop="email"
        label="邮箱"
        width="180">
        </el-table-column>
        <el-table-column
        prop="mobile"
        label="电话">
        </el-table-column>
        <el-table-column label="禁用">
            <template slot-scope="scope">
            <el-switch
            v-model="value2"
            active-color="#13ce66"
            inactive-color="#ff4949">
            </el-switch>
            </template>
        </el-table-column>
        <el-table-column label="操作">
        <template slot-scope="scope">
            <el-button type="primary" icon="el-icon-edit" plain></el-button>
            <el-button type="danger" icon="el-icon-delete" plain ></el-button>
            <el-button type="warning" icon="el-icon-check" plain></el-button>
        </template>
        </el-table-column>

  </el-table>

    <div class="block">
    <el-pagination
       
      
      :current-page="currentPage4"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400">
    </el-pagination>
  </div>


    </div>
</template>

<script>
import {getUserlist} from '@/api'
export default {
    data() {
      return {
        tableData:[],
        input5:'',
        value2: true,
        currentPage1: 5,
        currentPage2: 5,
        currentPage3: 5,
        currentPage4: 4
      }
    },
    created(){
        this.initList()
    },
    methods:{
        initList(){
            getUserlist({params:{query:'',pagenum:1,pagesize:3}}).then(res=>{
                console.log(res);
                this.tableData = res.data.users  
            })
        },
        
        
    }

}
</script>
<style lang="scss" scoped>
.user {
  .margin-20 {
    margin: 20px 0;
  }
  .search-input {
    width: 300px;
  }
  .page {
    padding: 5px 0;
    background-color: #D3DCE6;
  }
}
</style>


